<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="{{asset("/")}}libs/css/demo.css">
    <link rel="stylesheet" href="{{asset("/")}}libs/bower_components/bootstrap/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="{{asset("/")}}libs/bower_components/material-design-iconic-font/dist/css/material-design-iconic-font.min.css">
    <link rel="stylesheet" href="{{asset("/")}}libs/bower_components/animate.css/animate.min.css">
    <link rel="stylesheet" href="{{asset("/")}}libs/bower_components/metisMenu/dist/metisMenu.min.css">
    <link rel="stylesheet" href="{{asset("/")}}libs/bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.css">
    <link rel="stylesheet" href="{{asset("/")}}libs/bower_components/Waves/dist/waves.min.css">
    <link rel="stylesheet" href="{{asset("/")}}libs/bower_components/toastr/toastr.css">
    <link rel="stylesheet" href="{{asset("/")}}libs/bower_components/bootstrap-select/dist/css/bootstrap-select.css">
    <link rel="stylesheet" href="{{asset("/")}}libs/css/style.css">
    <link rel="shortcut icon" href="https://static.runoob.com/images/favicon.ico">


    <script src="{{asset("/")}}libs/bower_components/jquery/dist/jquery.min.js"></script>
    <script src="{{asset("/")}}libs/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
    <script src="{{asset("/")}}libs/bower_components/metisMenu/dist/metisMenu.min.js"></script>
    <script src="{{asset("/")}}libs/bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.js"></script>
    <script src="{{asset("/")}}libs/bower_components/Waves/dist/waves.min.js"></script>
    <script src="{{asset("/")}}libs/bower_components/toastr/toastr.js"></script>
    <script src="{{asset("/")}}libs/bower_components/bootstrap-select/dist/js/bootstrap-select.js"></script>
    <script src="{{asset("/")}}libs/js/common.js"></script>
    <script src="{{asset("/")}}libs/js/sweet_alert.js"></script>
    <title>天王翻译</title>
</head>
<body style="height: 100vh;width: 100vw">

<div class="container-fluid">
    <form action="translate" method="POST" enctype="multipart/form-data">
        @csrf
        <div class="row">
            <div class="col-md-6">
                <div class="content-box">
                    <div class="head info-bg clearfix">
                        <h5 class="content-title pull-left">请输入源语言</h5>
                    </div>
                    <div class="content">
                        <div class="form-group">
                            <label class="control-label info-color">请选择源语言</label>
                            <select name="form" class="form-control">
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->src=="auto"?'selected':''):''}}  value="auto">
                                    自动检测
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->src=="yue"?'selected':''):''}}  value="yue">
                                    粤语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->src=="kor"?'selected':''):''}}  value="kor">
                                    韩语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->src=="th"?'selected':''):''}}  value="th">
                                    泰语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->src=="pt"?'selected':''):''}}  value="pt">
                                    葡萄牙语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->src=="el"?'selected':''):''}}  value="el">
                                    希腊语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->src=="bul"?'selected':''):''}}  value="bul">
                                    保加利亚语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->src=="fin"?'selected':''):''}}  value="fin">
                                    芬兰语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->src=="slo"?'selected':''):''}}  value="slo">
                                    斯洛文尼亚语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->src=="cht"?'selected':''):''}}  value="cht">
                                    繁体中文
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->src=="zh"?'selected':''):''}}  value="zh">
                                    中文
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->src=="wyw"?'selected':''):''}}  value="wyw">
                                    文言文
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->src=="fra"?'selected':''):''}}  value="fra">
                                    法语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->src=="ara"?'selected':''):''}}  value="ara">
                                    阿拉伯语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->src=="de"?'selected':''):''}}  value="de">
                                    德语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->src=="est"?'selected':''):''}}  value="est">
                                    爱沙尼亚语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->src=="cs"?'selected':''):''}}  value="cs">
                                    捷克语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->src=="swe"?'selected':''):''}}  value="swe">
                                    瑞典语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->src=="vie"?'selected':''):''}}  value="vie">
                                    越南语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->src=="en"?'selected':''):''}}  value="en">
                                    英语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->src=="jp"?'selected':''):''}}  value="jp">
                                    日语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->src=="spa"?'selected':''):''}}  value="spa">
                                    西班牙语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->src=="ru"?'selected':''):''}}  value="ru">
                                    俄语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->src=="it"?'selected':''):''}}  value="it">
                                    意大利语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->src=="pl"?'selected':''):''}}  value="pl">
                                    波兰语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->src=="dan"?'selected':''):''}}  value="dan">
                                    丹麦语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->src=="rom"?'selected':''):''}}  value="rom">
                                    罗马尼亚语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->src=="hu"?'selected':''):''}}  value="hu">
                                    匈牙利语
                                </option>
                            </select>
                        </div>

                        <div class="form-group">
                            <label class="control-label info-color">Input warning</label>
                            <textarea class="form-control info-color" rows="3" name="query">
                            {{isset($ret)?$ret->trans_result[0]->src:''}}
                        </textarea>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-md-6">
                <div class="content-box">
                    <div class="head warning-bg clearfix">
                        <h5 class="content-title pull-left">这里是翻译结果</h5>
                    </div>
                    <div class="content">

                        <div class="form-group">
                            <label class="control-label warning-color">请选择目的语言</label>
                            <select name="to" class="form-control">
                                <option class="info-color" selected>请选择目的语言</option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->dst=="yue"?'selected':''):''}}  value="yue">
                                    粤语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->dst=="kor"?'selected':''):''}}  value="kor">
                                    韩语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->dst=="th"?'selected':''):''}}  value="th">
                                    泰语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->dst=="pt"?'selected':''):''}}  value="pt">
                                    葡萄牙语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->dst=="el"?'selected':''):''}}  value="el">
                                    希腊语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->dst=="bul"?'selected':''):''}}  value="bul">
                                    保加利亚语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->dst=="fin"?'selected':''):''}}  value="fin">
                                    芬兰语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->dst=="slo"?'selected':''):''}}  value="slo">
                                    斯洛文尼亚语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->dst=="cht"?'selected':''):''}}  value="cht">
                                    繁体中文
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->dst=="zh"?'selected':''):''}}  value="zh">
                                    中文
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->dst=="wyw"?'selected':''):''}}  value="wyw">
                                    文言文
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->dst=="fra"?'selected':''):''}}  value="fra">
                                    法语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->dst=="ara"?'selected':''):''}}  value="ara">
                                    阿拉伯语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->dst=="de"?'selected':''):''}}  value="de">
                                    德语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->dst=="est"?'selected':''):''}}  value="est">
                                    爱沙尼亚语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->dst=="cs"?'selected':''):''}}  value="cs">
                                    捷克语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->dst=="swe"?'selected':''):''}}  value="swe">
                                    瑞典语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->dst=="vie"?'selected':''):''}}  value="vie">
                                    越南语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->dst=="en"?'selected':''):''}}  value="en">
                                    英语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->dst=="jp"?'selected':''):''}}  value="jp">
                                    日语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->dst=="spa"?'selected':''):''}}  value="spa">
                                    西班牙语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->dst=="ru"?'selected':''):''}}  value="ru">
                                    俄语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->dst=="it"?'selected':''):''}}  value="it">
                                    意大利语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->dst=="pl"?'selected':''):''}}  value="pl">
                                    波兰语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->dst=="dan"?'selected':''):''}}  value="dan">
                                    丹麦语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->dst=="rom"?'selected':''):''}}  value="rom">
                                    罗马尼亚语
                                </option>
                                <option class="info-color"
                                        {{isset($ret)?($ret->trans_result[0]->dst=="hu"?'selected':''):''}}  value="hu">
                                    匈牙利语
                                </option>
                            </select>
                        </div>

                        <div class="form-group">
                            <label class="control-label warning-color">Input warning</label>
                            <textarea class="form-control" rows="3" id="text">
                            {{isset($ret)?$ret->trans_result[0]->dst:''}}
                        </textarea>
                            <span class="zmdi zmdi-copy" onclick="copyText()">复制文本</span>
                        </div>
                    </div>
                </div>
            </div>

        </div>
        <button class="form-control btn btn-primary" type="submit">翻译</button>
    </form>
</div>
<footer class="page-footer">Copyright &copy; 天王翻译版权所有。百度翻译提供翻译服务</footer>
</body>
<script type="text/javascript">

    function copyText() {
        /* 获取文本内容 */
        var copyText = document.getElementById("text");

        /* 选择复制内容 */
        copyText.select();
        copyText.setSelectionRange(0, 99999); /* 为移动设备设置 */

        /* 复制内容到文本域 */
        navigator.clipboard.writeText(copyText.value);

        // /* 弹出已复制的内容 */
        // alert("复制的文本为: " + copyText.value);

        swal({
            title: "复制文本成功",
            text: "复制的文本为: " + copyText.value,
            icon: "success",
        })



    }
</script>
</html>
